package com.mpyy.handler.purchase;

import com.alibaba.fastjson.JSON;
import com.mpyy.pojo.SupplierInfo;
import com.mpyy.service.purchase.SearchsupplierServiceInter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @version 1.0
 * @Descoription SearchSupplierInfo
 * @Author CG
 * @date 2022-03-15
 */
@Controller
public class SearchSupplierInfo {
    @Autowired
    @Qualifier(value = "searchsupplierServiceImpl")
    private SearchsupplierServiceInter searchsupplier;

    @RequestMapping(value = "/sraechSupplierInfo")
    @ResponseBody
    public  String sraechSupplierInfo(){
        List<SupplierInfo> supplierInfos = searchsupplier.searchsupplierInfo();

        Map<Object,Object> map = new HashMap<>();
        map.put("code",0);
        map.put("msg","");
        map.put("count",supplierInfos.size());
        map.put("data",supplierInfos);
        return JSON.toJSONString(map);
    }
}
